home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Network Support Library
/
RoseWare - Network Support Library.iso
/
apidev
/
dax1.exe
/
CLIENT
/
ADD
/
ADD.C
Wrap
C/C++ Source or Header
|
1992-07-15
|
4KB
|
96 lines
// ╔════════════════════════════════════════════════════════════════════╗
// ║ ║
// ║ module: add.c ║
// ║ abstract: This module contains an example that illustrates the ║
// ║ absolute minimum requirements for a client example ║
// ║ which talks to the DAX Engine. ║
// ║ ║
// ║ environment: NetWare 3.x v3.11 ║
// ║ Network C for NLMs SDK ║
// ║ CLib v3.11 ║
// ║ Network C for DOS v2.0 ║
// ║ NetWare C Interface DOS v1.2 ║
// ║ ║
// ║ This software is provided as is and carries no warranty ║
// ║ whatsoever. Novell disclaims and excludes any and all implied ║
// ║ warranties of merchantability, title and fitness for a particular ║
// ║ purpose. Novell does not warrant that the software will satisfy ║
// ║ your requirements or that the software is without defect or error ║
// ║ or that operation of the software will be uninterrupted. You are ║
// ║ using the software at your risk. The software is not a product ║
// ║ of Novell, Inc. or any of subsidiaries. ║
// ║ ║
// ╟────────────────────────────────────────────────────────────────────╢
// ║ maintenance history: ║
// ║ level date pi description ║
// ╟────────────────────────────────────────────────────────────────────╢
// ║ 001 07/15/92 kl initial release. ║
// ╚════════════════════════════════════════════════════════════════════╝
#include <stdio.h>
#include <conio.h>
#include <stdlib.h>
#include <string.h>
#if defined(WINCLNT)
#include <windows.h>
#endif
#include "h/appl.h"
#include "dap/dapapi.h"
static DAPDATA *dd;
void atexitproc()
{
if( dd ){
DAPDeAllocateSession(dd);
DAPDeInitialize(dd);
}
}
main(int argc, char *argv[])
{
int rc;
long x,y,z;
if( argc == 3 ){
x = atol(argv[1]);
y = atol(argv[2]);
}
else{
printf("usage: ADD op1 op2\n");
exit(1);
}
atexit(atexitproc);
if( (dd = DAPInitialize(SERVERNAME, SERVERTYPE)) == NULL ){
printf("Could not initialize DAP\n");
exit(1);
}
printf("Initialized okay...\n");
if( (rc = DAPAllocateSession(dd)) != NULL ){
printf("Allocate session failed '%s'",DAPTranslateReturnCode(rc));
exit(1);
}
printf("Attached to server '%s'\n",SERVERNAME);
if( (rc = DAPAddOperands(dd,x,y,&z)) != NULL ){
if( DAP_CRITICAL_ERROR(rc) ){
printf("\n\n\t%s. rc = %d\n",
DAPTranslateReturnCode(rc),rc);
DAPDisplaySessionData(dd);
exit(1);
}
else{
printf("\n%s\n",DAPTranslateReturnCode(rc));
}
}
printf("%ld + %ld = %ld\n",x,y,z);
if( (rc = DAPDeAllocateSession(dd)) != NULL ){
printf("\n\n\t%s. rc = %d\n",
DAPTranslateReturnCode(rc),rc);
}
DAPDeInitialize(dd);
dd = NULL;
return 0;
}